package com.co.server.entity.vote;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

public class TVoteUser {
    /**  */
    private Integer id;

    /** 投票Id */
    private Integer voteId;

    /** 投票条目id */
    private Integer voteItemId;

    /** 用户id */
    private Integer userId;

    /** 投票用户ip */
    private String voteIp;

    /** 创建时间 */
    @DateTimeFormat(pattern="yyyy-MM-dd HH-mm-ss")
    private Date createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getVoteId() {
        return voteId;
    }

    public void setVoteId(Integer voteId) {
        this.voteId = voteId;
    }

    public Integer getVoteItemId() {
        return voteItemId;
    }

    public void setVoteItemId(Integer voteItemId) {
        this.voteItemId = voteItemId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getVoteIp() {
        return voteIp;
    }

    public void setVoteIp(String voteIp) {
        this.voteIp = voteIp == null ? null : voteIp.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TVoteUser other = (TVoteUser) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getVoteId() == null ? other.getVoteId() == null : this.getVoteId().equals(other.getVoteId()))
            && (this.getVoteItemId() == null ? other.getVoteItemId() == null : this.getVoteItemId().equals(other.getVoteItemId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getVoteIp() == null ? other.getVoteIp() == null : this.getVoteIp().equals(other.getVoteIp()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getVoteId() == null) ? 0 : getVoteId().hashCode());
        result = prime * result + ((getVoteItemId() == null) ? 0 : getVoteItemId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getVoteIp() == null) ? 0 : getVoteIp().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", voteId=").append(voteId);
        sb.append(", voteItemId=").append(voteItemId);
        sb.append(", userId=").append(userId);
        sb.append(", voteIp=").append(voteIp);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}